//
//  SSConstant.swift
//  weibo
//
//  Created by 邵帅 on 16/6/23.
//  Copyright © 2016年 groupNineObject. All rights reserved.
//

import UIKit

/// 输出日志

/// - parameter message:  日志消息

/// - parameter logError: 错误标记，默认是 false，如果是 true，发布时仍然会输出

/// - parameter file:     文件名

/// - parameter method:   方法名

/// - parameter line:     代码行数

func printLog<T>(message: T,
              logError: Bool = false,
              file: String = __FILE__,
              method: String = __FUNCTION__,
              line: Int = __LINE__)
{
    if logError {
        print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(message)")
    } else {
        #if DEBUG
            print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(message)")
        #endif
    }
}

// 授权认证的一些信息
let AppKey = "4270406730"
let AppSecret = "a867683543fa80e222d8d6c2c91c55b4"
let AppRedirectURL = "http://www.baidu.com"

let kNotificationChanged = "changeRootViewController"
let kNotificationShowEmoticon = "kNotificationShowEmoticon"
let kNotificationDeleteEmoticon = "kNotificationDeleteEmoticon"
let kNotificationBigPicture = "kNotificationBigPicture"

//MARK:--颜色
/// RGB颜色
func RGB(r r: CGFloat, g: CGFloat, b: CGFloat) -> UIColor {
    return UIColor(red: r / 255, green: g / 255, blue: b / 255, alpha: 1)
}

/// 随机颜色
func RandomColor() -> UIColor {
    return RGB(r: CGFloat(random()) % 255, g: CGFloat(random()) % 255, b: CGFloat(random()) % 255)
}

//MARK:--
/// 屏幕宽高
let kUIScreenWidth = UIScreen.mainScreen().bounds.size.width
let KUIScreenHeight = UIScreen.mainScreen().bounds.size.height
let kUIScreenSize = UIScreen.mainScreen().bounds.size
let kUIScreenBounds = UIScreen.mainScreen().bounds